{% extends "base.html" %}

{% block title %}Distributed Log - Filters{% endblock %}

{% block content %}	
		{% block latest %}{% endblock %}
        <h2>My Filters</h2>
        <table cellpadding="3" cellspacing="3" border="0" width="100%" style="border: 1px solid;">
			<thead>
            <tr style="background-color: #FFFF00;">
				<th />
                <th>Description</th>
				<th>Summary</th>
				<th />
            </tr>
			</thead>
			<tbody>
            {% for filter in filters %}
			<tr class='{% cycle row_even,row_odd %}'>
				<td>
					<a href="/filters/delete" id="del_filter"
							onclick="if (confirm('Really delete the filter?')) { var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'DELETE'; f.action = this.href; var m = document.createElement('input'); m.setAttribute('type', 'hidden'); m.setAttribute('name', 'key'); m.setAttribute('value', '{{ filter.key }}'); f.appendChild(m);f.submit(); }; return false;"
						<image alt="Delete" border="0" src="/images/bin.png" />
					</a>
				</td>
                <td>{{ filter.description|escape }}</td>
				<td>{{ filter.to_string }}</td>
				<td>
					<a href="/?filter={{ filter.key }}">
						<image alt="Apply" border="0" src="/images/apply.png" />
					</a> &nbsp;
					<a href="/feed?key={{ filter.key }}">
						<image alt="RSS" border="0" src="/images/rss.png" />
					</a> &nbsp;
					<a href="/alerts/add?filter={{ filter.key }}">
						<image alt="Alert" border="0" src="/images/phone.png" />
					</a>
				</td>
            </tr>
            {% endfor %}
			</tbody>
        </table>
		<br />
		To add a filter, create one on the <a href="/">main log page</a>, then click "Save Filter"
{% endblock content %}	